package com.eshop.we.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.eshop.we.favorite.api.FavoriteService;
import com.eshop.we.favorite.dto.FavoriteDto;
import com.eshop.we.favorite.entity.Favorite;
import com.eshop.we.mapper.FavoriteMapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * <p>
 * 用户书籍收藏表 服务实现类
 * </p>
 *
 * @author anonymity
 * @since 2018-07-06
 */
@Service(interfaceClass = FavoriteService.class)
@Component
public class FavoriteServiceImpl extends ServiceImpl<FavoriteMapper, Favorite> implements FavoriteService {

    @Override
    public List<FavoriteDto> selectUserBooks(Integer userId) {
        return baseMapper.selectUserBooks(userId);
    }

    @Override
    public Integer updateFavoriteStatus(Integer favoriteId, Integer userId) {
        return baseMapper.updateFavoriteStatus(favoriteId,userId);
    }
}
